import java.io.File;
import java.io.IOException;
import java.net.URL;
import org.apache.commons.io.FileUtils;

public class FileUtils_use
{
    public static void main(String[] args) throws IOException {
            FileUtils.copyFile(new File("file1.txt"), new File("file2.txt"));
            URL url=new URL("https://www.baidu.com");
            FileUtils.copyURLToFile(url, new File("baidu.html"));
        }
    }

